home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-21
/
qemmtec.zip
/
STLTECH.TEC
< prev
Wrap
Text File
|
1993-03-02
|
13KB
|
222 lines
ID:QS QEMM-386's Stealth Technology
Quarterdeck Technical Note #168
by Michael Bolton
Last Revision: 2 March 1993
Q. What is Stealth?
Q. How does Stealth work?
Q. What is the difference between ST:M and ST:F?
Q. Which Stealth strategy is preferable?
Q. Does Stealth slow down my system?
Q. How can Stealth fail?
Q. If I'm having problems with Stealth, what should I do?
Q. What is Stealth?
-------------------
Traditionally, 386 memory managers such as QEMM-386 have been able to create
High RAM by associating physical extended memory with unused addresses between
640K and 1MB. Quarterdeck's Stealth technology (new to version 6 of QEMM-386)
is QEMM-386's method of creating more High RAM than previously thought
possible, by mapping memory to addresses that are used by system, video, disk,
and other ROMs.
Q. How does Stealth work?
-------------------------
To understand how Stealth works, it is useful to understand the concept of
MAPPING.
MAPPING is the process by which memory management hardware and software can
make memory appear in appropriate places at appropriate times; it's the
process of associating memory with an address. The exPANded memory
specification (EMS) uses mapping to make portions of exPANded memory appear
inside the EMS Page Frame when that memory is requested by a program. When a
program needs more memory than what is normally available to it under DOS, it
can request that some exPANded memory be allocated from either an EMS board,
or from the EMS memory created by a 386 exPANded memory manager. ExPANded
memory has no DOS addresses of its own, but can be made to appear at a valid
DOS address -- "mapped in". ExPANded memory pages that are not currently
needed may be "mapped out" -- relieved of their DOS addresses and put back
into the exPANded memory pool, with code and data still intact. When the
application needs these pages, they are "mapped in" to the EMS page frame
again. It is therefore possible for a program that uses exPANded memory to
have access to much more memory than DOS itself can see of its own accord;
users who are familiar with "bank switching" found on mainframe computers or
on older 64K home computers may remember this kind of technology.
Mapping is also useful for creating High RAM; in the same way as detailed
above, expanded memory can be associated with unused addresses between 640K
and 1MB. The EMS hardware and software co-operate to make memory appear where
there is otherwise none.
Stealth uses mapping for a new purpose. The 386 (or 486) chip can
be made to map memory in or out of DOS's address space at any time. Stealth
uses 386 mapping to map system, disk, or video ROMs in and out of DOS's
address space when appropriate, using one of two strategies -- ST:M and ST:F.
Q. What is the difference between ST:M and ST:F?
------------------------------------------------
ROMs on your system are accessed via interrupts -- which are conceptually
similar to BASIC subroutines. When your system boots up, it sets up something
called an interrupt vector table. This is a list of addresses where specific
ROM subroutines can be found. When a program on your system needs a certain
ROM function (for example, writing coloured text to the screen), it sets up
some data in appropriate places, and then calls the interrupt with a processor
INT instruction. The processor then looks at the interrupt vector table to
find out the address where the ROM function can be found. The calling program
jumps to that address, the ROM subroutine gets run, and then control is
returned to the calling program.
When you use Stealth, as your system boots, QEMM-386 takes control of
interrupts that are in use by the ROMs on your system, and points those
interrupts into itself. This way, QEMM-386 can monitor exactly when a ROM
interrupt occurs, and can manage the interrupt appropriately.
When you use ST:M ("Map Mode"), QEMM-386 maps system, video, disk ROMs, and
any other "Stealthable" ROMs out of the first megabyte to addresses elsewhere
in the processor's memory map. (For information on what is "Stealthable", see
"How can Stealth fail?" below.) When the ROM is needed by the system,
QEMM-386 maps the appropriate ROM code into the expanded memory page frame.
The ROM code now has a valid DOS address at which it can execute, and it does
so normally. When the ROM routine is finished, QEMM-386 then remaps the ROM
elsewhere outside of DOS's address space.
When you use ST:F ("Frame Mode"), QEMM-386 leaves the system, video, and disk
ROMs where they are normally found. QEMM-386 then maps the EMS page frame to
such that it lies on top of a ROM. Expanded memory can then be mapped into
the EMS page frame. When the ROM that has been hidden by the page frame is
needed, QEMM-386 momentarily disables expanded memory usage and maps the page
frame out of DOS's address space, exposing the ROM beneath. The ROM code then
executes normally. When the ROM routine is finished, QEMM-386 can then
re-enable the EMS page frame, and lie it back down over the ROM.
Q. Which Stealth strategy is preferable?
----------------------------------------
Since ST:M is capable of mapping almost all ROMs out of DOS's address space,
and thus leaves you with much more High RAM, it is the better of the two
options. ST:F should only be needed on a very small number of systems; its
object is to ensure compatibility with machines that have ROMs that jump to
each other without using an interrupt to do so.
Q. Does Stealth slow my system down?
------------------------------------
Stealth does add some small amount of overhead to ROM BIOS interrrupts. Since
most application programs spend very little time calling ROM code, the
slowdowns are usually imperceptible or insignificant to the user. Ironically,
since benchmark programs often call ROM interrupts repeatedly (some do almost
nothing but this), the greatest slowdown will be seen in benchmark results;
these rarely have much to do with the speed of useful programs, however. It
should be noted that QEMM-386's ROM parameter can provide significant
performance increases. Using Stealth with the ROM parameter is typically
faster than not using QEMM-386 at all.
Q. How can Stealth fail?
------------------------
Stealth is a robust and proven technology. However, some programs and some
system ROM implementations can interfere with Stealth's strategies. Note that
the problems described here are infrequent and system-specific, and that most
users will experience no difficulty at all with Stealth.
Note that in the above description of how Stealth works, each strategy depends
on a processor interrupt being asserted. This is the normal way of calling a
piece of ROM code; processor registers are loaded with data and with
information which denotes exactly which ROM service is being requested, and
then a processor INT instruction is called. BASIC programmers will recognize
that this is similar to the process of loading a few variables with data, and
then calling a subroutine with a GOSUB instruction; most good texts favour
this method of programming. However, it is possible (though relatively
uncommon) for a piece of ROM code to JUMP to a specific address without
asserting an interrupt. (This is analogous to a BASIC GOTO, rather than a
GOSUB; GOTOs are frowned upon by expert programmers, since a GOTO presumes
that the address to which you are going will remain constant and unchanging.)
In this case, QEMM-386 will not be able to intercept an interrupt, and thus
may not have a chance to make sure that the appropriate portion of the ROM
code is mapped into the page frame (ST:M). In such circumstances, ST:F is
often helpful, since the Page Frame will not reappear until after the ROM BIOS
call is completely done.
* Many ROM-BIOS-based system setup programs exhibit this same sort of
behaviour, as do installation routines for some video cards. If you wish to
run such programs, it is far better to disable QEMM-386 temporarily than to
sacrifice the large amounts of extra High RAM that ST:M can provide. Setup
programs should need to be run infrequently, and typically require a reboot
before the modified settings take effect. High RAM is generally much more
useful. It is worth weighing the benefits of instant access to your setup
program against the extra High RAM that Stealth can provide; the decision
should not be a difficult one.
* Some programs find the address of a given piece of ROM at startup, and then
jump directly to that address later on, at a time when the ROM may not be
mapped into memory. Programs like these will often require that a portion of
the ROM be EXCLUDEd on the QEMM386.SYS line in CONFIG.SYS.
* Some ROMs do not have any interrupts pointing to them at startup. If this
is the case, QEMM-386 will not be able to detect where a given interrupt
should point, and thus may not be able to manage that interrupt properly. Some
programs refuse to load unless they see an interrupt pointing to its normal
location; these programs can be loaded before QEMM-386 if necessary.
* Some programs make invalid assumptions about the EMS page frame. In some
cases, programs assume that the state of the EMS page frame will remain
unchanged even after they abandon an EMS handle; this is akin to assuming that
you can get your property back after leaving it at the end of the driveway on
garbage pick-up day. This fails with Stealth because, by default, the page
frame is immediately unmapped after a handle has been abandoned -- as if, in
the above example, the city picks up the garbage pretty much immediately -- as
soon as you get back into your house. The UFP:N parameter suppresses this
feature, perhaps at the expense of some speed.
* Some applications assume that the contents of the page frame will be
preserved across a hardware interrupt -- like assuming that your coat will
never get moved from the place in which you saw the cloakroom attendant put
it. This is an invalid assumption, and can cause problems not only with
Stealth, but with EMS-using TSRs as well.
* Other programs outright violate the Expanded Memory Specification by placing
their interrupt stacks in the page frame.
Fortunately, the programs that exhibit these problems are rare. Furthermore,
Quarterdeck is happy to work with commercial software developers who are
having difficulties with Stealth compatibility.
ROM code is normally read 8 or 16 bits at a time, and 32-bit RAM is therefore
much faster. (You can see this in action by looking at Manifest First Meg /
Timings, first without the ROM parameter on the QEMM386.SYS line in
CONFIG.SYS, and then with ROM added to the end of that line.) Some video ROM
speed-up drivers (TVGABIO.SYS, RAMBIOS.SYS, FASTBIOS.SYS, SPEED_UP.SYS...
these typically come on the utilities diskettes provided with your video card)
work by copying the contents of video ROM to conventional RAM. These programs
will often fail if Stealth is active; again, they assume that the video ROM is
in its normal place, and has not been moved by Stealth. QEMM-386's ROM
parameter provides the same feature as these drivers do, with three important
advantages: first, QEMM-386 copies the video ROM into 32-bit RAM, and then
write-protects the RAM so that some errant program does not overwrite the ROM
code. Second, QEMM-386's ROM parameter costs neither conventional memory nor
High RAM to provide this feature -- the video drivers mentioned above will
typically take 32K of one or the other. Finally, the ROM parameter is fully
compatible with Stealth.
Q. If I'm having problems with Stealth, what should I do?
---------------------------------------------------------
Stealth problems can be resolved by consulting Quarterdeck Technical Note
#205, "Trouble-shooting Stealth" (STEALTH.TEC). This and other Quarterdeck
Technical Notes are available on the Quarterdeck BBS at (310) 314-3227,
Compuserve (!GO QUARTERDECK), or large local BBS systems, and also via our
Q/FAX fax retrieval service; from the handset of your fax machine, call (310)
314-3214, or in Canada, (416) 665-5070.
************************************************************************
* Trademarks are property of their respective owners. *
*This technical note may be copied and distributed freely as long as it*
*is distributed in its entirety and it is not distributed for profit. *
* Copyright (C) 1993 by Quarterdeck Office Systems *
************************ E N D O F F I L E *************************